import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.HashMap;
import java.util.Map;


public class AgainstARock {
	
	public static void solve(String name) throws IOException {
		Map<String, String> map1 = new HashMap<String, String>();
		Map<String, String> map2 = new HashMap<String, String>();
		
		map1.put("paper", "scissors");
		map1.put("rock", "paper");
		map1.put("lizard", "rock");
		map1.put("Spock", "lizard");
		map1.put("scissors", "Spock");
		
		map2.put("lizard", "scissors");
		map2.put("paper", "lizard");
		map2.put("Spock", "paper");
		map2.put("rock", "Spock");
		map2.put("scissors", "rock");
		
		String prev = "";
		
		BufferedReader r = new BufferedReader(new FileReader(name + ".in"));
		Writer w = new FileWriter(name + ".out");
		
		int n = Integer.parseInt(r.readLine());
		
		for (int i = 0; i < n; i++) {
			String g = r.readLine();
			String answ = map1.get(g).equals(prev) ? map2.get(g) : map1.get(g);
			w.append(answ + "\n");
			prev = answ;
		}
		
		r.close();
		w.close();
	}
	
	public static void main(String[] args) throws IOException {
		solve("a1");
		solve("a2");		
	}

}
